package com.zzh.study.router;

import com.zzh.study.handler.MyWebHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

/**
 * @PackageName:com.zzh.study.router
 * @ClassName:BaseRouter
 * @Description:
 * @author:zhangzhanheng
 * @date: 2020/12/18 18:28
 */
@Configuration
public class BaseRouter {
    private static final String ROUTE_PATH = "/product/route/";

    @Bean
    public RouterFunction<ServerResponse> routers(MyWebHandler myWebHandler) {
        return RouterFunctions.route()
                .POST(RoutePath.save,myWebHandler::save).build();
    }


}
